import 'package:gold/generated/json/base/json_field.dart';
import 'package:gold/generated/json/commission_list_model.g.dart';
import 'dart:convert';
export 'package:gold/generated/json/commission_list_model.g.dart';

@JsonSerializable()
class CommissionListModel {
	List<CommissionModel>? data;
	int? total;
	int? count;
	@JSONField(name: 'per_page')
	int? perPage;
	@JSONField(name: 'current_page')
	int? currentPage;
	@JSONField(name: 'total_pages')
	int? totalPages;

	CommissionListModel();

	factory CommissionListModel.fromJson(Map<String, dynamic> json) => $CommissionListModelFromJson(json);

	Map<String, dynamic> toJson() => $CommissionListModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class CommissionModel {
	/// 提成ID
	int? id;
	/// 用户昵称
	String? nickname;
	/// 用户头像
	String? avatar;
	/// 提成金额
	double? amount;
	/// 状态0: 待结算, 1: 已结算, 2: 已取消
	String? status;
	/// 订单ID
	@JSONField(name: 'order_id')
	int? orderId;
	/// 结算时间
	@JSONField(name: 'settled_at')
	String? settledAt;
	/// 取消时间
	@JSONField(name: 'canceled_at')
	String? canceledAt;
	/// 创建时间
	@JSONField(name: 'created_at')
	String? createdAt;
	/// 订单信息
	CommissionOrderModel? order;

	CommissionModel();

	factory CommissionModel.fromJson(Map<String, dynamic> json) => $CommissionModelFromJson(json);

	Map<String, dynamic> toJson() => $CommissionModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class CommissionOrderModel {
	/// 订单号
	@JSONField(name: 'order_no')
	String? orderNo;
	/// 数量
	int? quantity;
	/// 付款金额
	@JSONField(name: 'pay_price')
	double? payPrice;
	/// 产品名
	@JSONField(name: 'product_name')
	String? productName;

	CommissionOrderModel();

	factory CommissionOrderModel.fromJson(Map<String, dynamic> json) => $CommissionOrderModelFromJson(json);

	Map<String, dynamic> toJson() => $CommissionOrderModelToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}